<div class="songs_index">
			<p>Order by: <?php echo $this->Paginator->sort('date');?></p>
<?php
$i = 0;
foreach ($songs as $song):
	$class = null;
?>
<?php  
$up=null;
$down=null;
foreach ($scores as $s => $o) { 
	if($o['Score']['song_id']==$song['Song']['id']){
		if($o['Score']['direction']=='0'){
			$down=true;
		} else if ($o['Score']['direction']=='1'){
			$up=true;
		}
	}
}?>
<table>
<tr id="<?php echo $song['Song']['id'] ?>">
<td class="score_td">
				<div id="up_arrow_<?php echo $song['Song']['id']; ?>" <?php if ($up){echo 'class="arrow_up_hit"';} else { echo 'class="arrow_up"';} ?>></div>
<div class="score">
<p id="score_<?php echo $song['Song']['id']; ?>" class="score"><?php echo $song['Song']['score']; ?></p></div>
			<div id="down_arrow_<?php echo $song['Song']['id']; ?>" <?php if ($down){echo 'class="arrow_down_hit"';} else { echo 'class="arrow_down"';} ?>></div>
</td>
<td>
		<?php 
			if ($song['Sitemask']['embedurl']){
		echo '<p class="song_title" id="song_title_'.$song['Song']['id'].'">';
		echo "\n";
		echo $song['Song']['title'];
		echo ' (<a href=http://'.$song['Song']['url'].' target="_blank">'.$song['Sitemask']['name'].'</a>)</p>';
			echo '<div id="song_play_'.$song['Song']['id'].'" style="display:none;">';
			echo $song['Sitemask']['embedurl'];
		echo '</div>';
		} else {
			echo '<p class="only_url">';
		echo '<a href=http://'.$song['Song']['url'].' target="_blank">'.$song['Song']['title'].'</a></p>';
		}?>
</p>
<p>
Submited by 
			<?php echo $this->Html->link($song['User']['username'], array('controller' => 'users', 'action' => 'view', $song['User']['id'])); ?>
 at 
		<?php echo $song['Song']['date']; ?>
		to 
			<?php echo $this->Html->link($song['Category']['title'], array('controller' => 'categories', 'action' => 'view', $song['Category']['id'])); ?>
</p>
<p>
<div>
  	<?php echo $this->Html->link('Comments', array('controller' => 'songs', 'action' => 'view', $song['Song']['id']), array('class' => 'comment_it')); ?>
 <span class="share_it">Share it:</span>
<a href="http://www.facebook.com/sharer.php?u=http://www.audivit.com/songs/view/<?php echo $song['Song']['id'] ?>%23song_title_<?php echo $song['Song']['id'] ?>&amp;t=<?php echo $song['Song']['title'] ?>" target="_blank">
<?php echo $this->Html->image('fb.png', array('title' => 'Share on Facebook!'))?></a>
<a href="http://twitter.com/home?status=is listening to <?php echo $song['Song']['title'] ?> at site with user picked music - http://www.audivit.com/songs/view/<?php echo $song['Song']['id'] ?>" target="_blank">
<?php echo $this->Html->image('twitter.png', array('title' => 'Share on Twitter!'))?></a>
<div class="g-plusone" data-size="small" data-count="false" data-href="http://www.audivit.com/songs/view/<?php echo $song['Song']['id'] ?>%23song_title_<?php echo $song['Song']['id']; ?>"</div>
</div>
</p>
</td>
</tr>
</table>
<?php endforeach; ?>
	<p>
<?php
			echo $this->Paginator->counter(array(
				'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
			));
?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
